package com.iscas.tech.utils;

import com.alibaba.fastjson.JSON;
import io.geekidea.springbootplus.framework.common.api.ApiResult;

import javax.servlet.http.HttpServletResponse;

public class ResponseUtil {
    public static <T> void write(HttpServletResponse response, ApiResult<T> result) throws Exception {
        response.setContentType("application/json;charset=UTF-8");
        response.getWriter().write(JSON.toJSONStringWithDateFormat(result, "yyyy-MM-dd HH:mm:ss"));
    }
}
